package com.xinyu.controller;

import com.xinyu.service.IAAngleProfileService;
import com.xinyu.vo.AAngleVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@RestController
@RequestMapping("/angleProfile")
public class AAngleProfileController {

    @Autowired
    private IAAngleProfileService angleProfileService;

    @PostMapping("/upload")
    public ResponseEntity<?> uploadFile(@RequestParam("file") MultipartFile file) {
        try {
            List<List<Integer>> list = angleProfileService.processExcelFile(file);
            return ResponseEntity.ok(list);
        } catch (Exception e) {
            return ResponseEntity.badRequest().body("Error processing file: " + e.getMessage());
        }
    }
}